<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">	
		  <c:forEach items="${pageInfo.list}" var="a">
				<article class="post type-post">
					<figure class="thumbnail">
						<a href="/article/${a.articleId}"> 
							<img width="280" height="210"	src="/resource/img/thumbnail/random/img_${a.articleId%15}.jpg" class="attachment-content size-content wp-post-image" >
						</a>
						<span class="cat">
							 <a href="/category/${a.categoryList[1].categoryId}">  ${a.categoryList[1].categoryName}</a>
						</span>
					</figure>
	
					<header class="entry-header">
						<h2 class="entry-title">
							<a href="/article/${a.articleId}" rel="bookmark">${a.articleTitle}</a>
						</h2>
					</header>
					
					<div class="entry-content">
						<div class="archive-content"> ${a.articleSummary}...</div>
						<span class="title-l"></span> 
						<span class="new-icon"> 
								 <c:choose>
	                                <c:when test="${a.articleStatus == 2}">
	                                    <i class="fa fa-bookmark-o"></i>
	                                </c:when>
	                                <c:otherwise>
	                                    <jsp:useBean id="nowDate" class="java.util.Date"/>
	                                    <c:set var="interval"  value="${nowDate.time - a.articleCreateTime.time}"/>
	                                    <fmt:formatNumber value="${interval/1000/60/60/24}" pattern="#0"   var="days"/>
	                                    <c:if test="${days <= 7}">NEW</c:if>
	                                </c:otherwise>
	                            </c:choose>
						</span> 
						
						<span class="entry-meta"> 
							 <span class="date">  <fmt:formatDate value="${a.articleCreateTime}" pattern="yyyy年MM月dd日"/>  &nbsp;&nbsp; </span> 
						     <span class="views"> <i class="fa fa-eye"></i>	  ${a.articleViewCount} views </span> 
						     <span class="comment">
						     	&nbsp;&nbsp; 
						     	<a href="/article/${a.articleId}#comments" rel="external nofollow"> 
						     			<i class="fa fa-comment-o"></i> 
						     		    <c:choose>
	                                        <c:when test="${a.articleCommentCount == 0}">
	                                           	 发表评论
	                                        </c:when>
	                                        <c:otherwise>
	                                            ${a.articleCommentCount}
	                                        </c:otherwise>
	                                    </c:choose>
						     	</a>
							 </span>
						</span>
						<div class="clear"></div>
					</div>
				
					<span class="entry-more"> 
						<a href="/article/${a.articleId}" rel="bookmark"> 阅读全文 </a>
					</span>
				</article>
			</c:forEach>
		</main>
		
		<!-- 分页 -->
		 <%@ include file="paging.jsp" %>
			
	</div>